package xj.graph2d.tree;

import javax.swing.tree.DefaultMutableTreeNode;

import xj.graph2d.SimpleDrawDocument;

public class DocumentTreeNode 
  extends DefaultMutableTreeNode 
  implements xj.util.gui.TreeNodeToolTips {

  public DocumentTreeNode(SimpleDrawDocument doc) {
    this.doc = doc;
  }

  public void setDocument(SimpleDrawDocument doc) {
    this.doc = doc;
  }

  @Override
  public String toString() {
    if (doc != null) {
      return doc.getName();
    } else {
      return null;
    }
  }

  public String getTip() {
    return toString();
  }

  protected SimpleDrawDocument doc;

}
